package com.unittec.zk.provider.log;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.core.env.Environment;

import com.unittec.zk.provider.ApplicationContextProvider;

import springfox.documentation.swagger2.annotations.EnableSwagger2;

@SpringBootApplication(scanBasePackages = {"com.unittec.zk.provider"})
@MapperScan(basePackages = "com.baomidou.mybatisplus.core.mapper")
@EnableSwagger2
@EnableHystrix
@EnableDiscoveryClient
public class LogApplication {

    public static void main(String[] args) {
        SpringApplication.run(LogApplication.class, args);
        curEnvironmentOut();
    }

    private static void curEnvironmentOut() {
        System.out.println("****************************************************************************");
        Environment env = ApplicationContextProvider.getBean(Environment.class);
        String profile = env.getProperty("spring.profiles.active");
        System.out.println("当前启动环境:" + profile);
        System.out.println("****************************************************************************");
    }

}
